﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DesignPatternDemoCApp.Structured.CompositePattern
{
    /// <summary>
    /// 该Word文档类就是叶子构件的定义，该类型就相当于是Leaf类型，不能在包含子对象
    /// </summary>
    public sealed class Word : Folder
    {
        public override void Add(Folder folder)
        {
            throw new Exception("Word文档不具有该功能");
        }

        public override void Open()
        {
            Console.WriteLine("打开Word文档，开始进行编辑");
        }

        public override void Remove(Folder folder)
        {
            throw new Exception("Word文档不具有该功能");
        }
    }
}
